package com.omazan.nativeClient;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import com.omazan.db.GeneralDBMethods;
import com.omazan.utils.OmazanException;

public class UserConsole {

	public static void main(String[] args) throws IOException, OmazanException {

		BufferedReader reader = new BufferedReader(new InputStreamReader(
				System.in));
		int y=0;
 GeneralDBMethods.getInstance().getSessionFactoryForDbOperation();
		while (y==0) {
			System.out.println("OMAZON DATA MANAGEMENT CONSOLE:");
			System.out.println("Select Operation.");
			System.out.println("1.USER MANAGEMENT");
			System.out.println("2.PRODUCT MANAGEMENT");
			System.out.println("3.EXIT CONSOLE");
			String userInput = reader.readLine();
			int operation = Integer.parseInt(userInput);
			UserOperations userOperations = new UserOperations();

			switch (operation) {
			case 1:
				System.out.println("USER SCREEN:");
				userOperations.usertypeOperations();
				break;
			case 2:
				System.out.println("PRODUCT SCREEN:");
				userOperations.productOperations();
				break;

			default:
				y++;
				break;
				
			}
		}
		System.exit(0);
	}
}